﻿using Framework.Core.Io;

namespace Framework.Core.Process.Tasks
{
    internal static class PsZip
    {
        private const string PsZipFileName = @"PsZip.exe";
        private static readonly string PsZipName = PsZipFileName.Deploy();

        internal struct PsZipExtract : ICommand
        {
            public string Name { get { return PsZipName; } }
            public string FileName { get { return PsZipFileName; } }
            public string Arguments { get; private set; }
            public bool IsNative { get { return false; } }

            static PsZipExtract()
            {
                PsZipFileName.Deploy();
            }

            public PsZipExtract(string zipPath, string outPath)
                : this()
            {
                Arguments = string.Format(@"-x ""{0}"" ""{1}""", zipPath, outPath);
            }
        }

        internal struct PsZipCompress : ICommand
        {
            public string Name { get { return PsZipName; } }
            public string FileName { get { return PsZipFileName; } }
            public string Arguments { get; private set; }
            public bool IsNative { get { return false; } }

            static PsZipCompress()
            {
                PsZipFileName.Deploy();
            }

            public PsZipCompress(string inPath, string zipPath)
                : this()
            {
                Arguments = string.Format(@"-z ""{0}"" ""{1}""", inPath, zipPath);
            }
        }
    }
}
